package day0724;

import java.util.Arrays;

public class Test8 {
    public static void main(String[] args) {
        int[]  arr={2, 6, 4, 8, 9, 1};
        //用for循环求所有元素的平均值
        int sum=0;
        for(int i=0;  i<  arr.length;  i++){
            sum = arr[i]+sum;
        }
        System.out.println(sum/arr.length);

    }
}
